package com.pipe.protocol.query;

import com.pipe.util.MysqlProtocolUtil;
import io.netty.buffer.ByteBuf;

/**
 * @author Kiven
 */
public class FieldCountPackage {
    private long fieldCount;

    public FieldCountPackage(long fieldCount) {
        this.fieldCount = fieldCount;
    }

    public static FieldCountPackage build(ByteBuf byteBuf) {
        long fieldCount = MysqlProtocolUtil.readLenencIntFromBytebuf(byteBuf);
        return new FieldCountPackage(fieldCount);
    }

    public long getFieldCount() {
        return fieldCount;
    }
}